<template>
  <div>
    <div class="mala-header">
      <div class="left">
        <div class="logo"></div>
        <div class="title">
          <div class="cn">群众呼声智慧分析平台</div>
          <div class="en">People's Livelihood Intelligence Analysis Platform</div>
        </div>
        <div class="time">
          <p class="timer"> {{ dateDay }}</p>
          <p class="date"><span>{{ dateWeek }}</span><span>{{ dateYear }}</span></p>
        </div>
      </div>
      <div class="right">
        <div class="menu">
          <div class="menu-item">今天</div>
          <div class="menu-item">昨天</div>
          <div class="menu-item">最近七天</div>
          <div class="menu-item">本月</div>
          <div class="menu-item">本年</div>
          <div class="menu-item">指定时间</div>
        </div>
      </div>
    </div>
<!--    <dv-decoration-10 style="width:100%;height:5px;"/>-->
  </div>
</template>
<script>
import {formatTime} from '../../utils/index.js'

export default {
  data() {
    return {
      dateDay: null,
      dateYear: null,
      dateWeek: null,
      decorationColor: ['#568aea', '#000000'],
      weekday: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
    }
  },
  mounted() {
    this.timeFn()
  },
  beforeDestroy() {
    clearInterval(this.timing)
  },
  methods: {
    timeFn() {
      this.timing = setInterval(() => {
        this.dateDay = formatTime(new Date(), 'HH: mm: ss')
        this.dateYear = formatTime(new Date(), 'yyyy.MM.dd')
        this.dateWeek = this.weekday[new Date().getDay()]
      }, 1000)
    },
  }
}
</script>
<style lang="scss" scoped>
.mala-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
  padding: 10px 15px;
  &:after{
    background-image: linear-gradient(to right, #d3e4ff, #819cd9);
    opacity: .6;
    height:1px;
    left:0;
    bottom:-10px;
    content:"";
    width:100%;
    position: absolute;
  }
  //border-bottom: 2px solid hsla(0, 0%, 100%, .2);

  .left {
    width: 50%;
    display: flex;
    align-items: center;

    .logo {
      width: 50px;
      height: 50px;
      background-size: 100% 100%;
      background-image: url(../../assets/img/logo.png);
    }

    .time {
      margin-left: 80px;
      display: flex;
      position: relative;
      &:after{
        height:25px;
        width:1px;
        background: #fff;
        position: absolute;
        left:-35px;
        content:"";
        top:50%;
        transform: translateY(-50%);
        background-image: -webkit-linear-gradient(top, #d3e4ff, #819cd9);
      }

      p {
        //color:#8face9;
        font-size: 16px;;
        background-image: -webkit-linear-gradient(top, #d3e4ff, #819cd9);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;

        &.date {
          font-family: "number";
          font-size: 14px;
          display: flex;
          margin-left: 20px;
          flex-direction: column;
          justify-content: space-between;
          >span{
            &:last-child{
              font-size: 16px;
              font-weight: bolder;
            }
          }
        }

        &.timer {
          display: flex;
          align-items: center;
          font-family: "number";
          font-weight: bolder;
          font-size: 36px;
        }
      }
    }

    .title {
      margin-left: 15px;
      height: 50px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;

      .cn {
        font-family: "阿里妈妈数黑体 Bold";
        background-image: -webkit-linear-gradient(top, #d3e4ff, #819cd9);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: bolder;
        font-size: 26px;
        color: #d3e4ff;
        line-height: 32px;
        margin-top: 2px;
      }

      .en {
        margin-bottom: -2px;
        background-image: -webkit-linear-gradient(top, #d3e4ff, #819cd9);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: normal;
        font-size: 14px;
        letter-spacing: 2px;
      }
    }
  }

  .center {
    position: absolute;
    display: flex;
    left: 50%;
    transform: translateX(-50%);
    top: 40px;
    justify-content: space-between;

    .h-title {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      top: 20px;
    }

    .c-title {
      position: absolute;
      left: 50%;
      //font-family:"阿里妈妈数黑体 Bold";
      font-size: 38px;
      font-weight: bolder;
      width: 600px;
      align-items: center;
      line-height: 40px;
      top: 50%;
      transform: translate(-50%, -10%);
      background-image: linear-gradient(to bottom, #d3e4ff 20%, #819cd9 80%);
      -webkit-background-clip: text;
      color: transparent;

      > div {
        margin: 0 10px
      }
    }
  }

  .right {
    .menu {
      margin-top: -5px;
      display: flex;

      .menu-item {
        margin-left: 30px;
        font-size: 26px;
        font-family: "阿里妈妈数黑体 Bold";
        cursor: pointer;
        font-weight: bolder;
        line-height: 25px;
        background-image: linear-gradient(to right, #d3e4ff, #819cd9);
        -webkit-background-clip: text;
        color: transparent;
      }
    }
  }
}
</style>


